package com.tiger.communal.service.impl;

import java.util.List;
import java.util.Map;

import com.tiger.communal.domain.Hydropower;
import com.tiger.communal.mapper.HydropowerMapper;
import com.tiger.communal.service.IHydropowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 水/电总表Service业务层处理
 *
 * @author standard
 * @date 2022-10-13
 */
@Service
public class HydropowerServiceImpl implements IHydropowerService {
    @Autowired
    private HydropowerMapper hydropowerMapper;

    /**
     * 查询水/电总表
     *
     * @param id 水/电总表主键
     * @return 水/电总表
     */
    @Override
    public Hydropower selectHydropowerById(Long id) {
        return hydropowerMapper.selectHydropowerById(id);
    }

    /**
     * 查询水/电总表列表
     *
     * @param hydropower 水/电总表
     * @return 水/电总表
     */
    @Override
    public List<Hydropower> selectHydropowerList(Hydropower hydropower) {
        return hydropowerMapper.selectHydropowerList(hydropower);
    }

    /**
     * 新增水/电总表
     *
     * @param hydropower 水/电总表
     * @return 结果
     */
    @Override
    public int insertHydropower(Hydropower hydropower) {

        return hydropowerMapper.insertHydropower(hydropower);
    }

    /**
     * 修改水/电总表
     *
     * @param hydropower 水/电总表
     * @return 结果
     */
    @Override
    public int updateHydropower(Hydropower hydropower) {
        return hydropowerMapper.updateHydropower(hydropower);
    }

    /**
     * 批量删除水/电总表
     *
     * @param ids 需要删除的水/电总表主键
     * @return 结果
     */
    @Override
    public int deleteHydropowerByIds(Long[] ids) {
        return hydropowerMapper.deleteHydropowerByIds(ids);
    }

    /**
     * 删除水/电总表信息
     *
     * @param id 水/电总表主键
     * @return 结果
     */
    @Override
    public int deleteHydropowerById(Long id) {
        return hydropowerMapper.deleteHydropowerById(id);
    }

    /**
     * 查询水电费支出
     *
     * @param id 水/电总表主键
     * @return 结果
     */
    @Override
    public Map<String, Object> getTotalHydropowerAmount(Long id) {
        return hydropowerMapper.selectTotalHydropowerAmount(id);
    }
}
